extends ../layout

block content
	.container.contentTop
		.row
			each category in categories
				.panel.panel-default
					.panel-heading 
						h4 
							a(href='/results?cat=#{category._id}&p=0') #{category.name}
					.panel-body
						if category.movies && category.movies.length > 0
							each item in category.movies
								.col-md-2.text-center
									.thumbnail
										a(href="/movie/#{item._id}")
											if item.poster.indexOf('http:') > -1
												img(src="#{item.poster}", alt="#{item.title}", width="150px" height="170px")
											else
												img(src="/upload/#{item.poster}", alt="#{item.title}", width="150px" height="170px")
										.caption
											h4 #{item.title}
											p: a.btn.btn-primary(href="/movie/#{item._id}", role="button") 看预告片